$(function(){
    // alert("hi");
    $.ajax({
        type: "POST",
        url: '/getCollegeList',
        data: "json",
        async: true,
        success: function(data) {
            // $("#classCollege").append(new Option(data))
            for (x in data) {
                $("#classCollege").append(new Option(data[x], data[x]))
            }
        }
    });
});

$("#classCollege").change(function() {
    $("#teacherInfo").html("<option>--请选择--</option>")
    var val = $("#classCollege option:selected").val();
    var data = {"data": val}
    $.ajax({
        type: "POST",
        url: '/getTeacherInfoList',
        dataType: "json",
        async: true,
        data: data,
        success: function(data) {
            // alert(data.length)
            for (x in data) {
                $("#teacherInfo").append(new Option(data[x], data[x]))
            }

        }
    });
});
